/** 
 * File Name:ResultActivity.java 
 * Package Name:cn.wikiflyer.zxing.android 
 * Date:2014年12月4日下午3:59:52 
 * Copyright (c) 2014, chenzhou1025@126.com All Rights Reserved. 
 * 
 */

package cn.wk.zxing.android;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import cn.wk.libs4a.R;
import cn.wk.libs4a.WKBaseActivity;

/**
 * ClassName:ResultActivity <br/>
 * Date: 2014年12月4日 下午3:59:52 <br/>
 * 
 * @author wangjing
 * @see
 */
public class CaptureResultActivity extends WKBaseActivity {

	private String text;
	private String type;
	private TextView tv_result;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	public void loadXml() {
		setContentView(R.layout.captureresult_lay);
	}

	@Override
	public void init() {
		
		Intent in = getIntent();
		text = in.getStringExtra("result");
		type = in.getStringExtra("type");
		
		tv_result = (TextView) findViewById(R.id.textView_result);
		getHeader().setClickListener(new OnClickListener() {
			public void onClick(View v) {
				finish();
			}
		}, null, null);
	}

	@Override
	public void setData() {
		if (type.equals("text") || type == "text") {
			if (text.contains("http")) {

			} else {
				tv_result.setText(TextUtils.isEmpty(text) ? "empty" : text);
			}
		} else {
			tv_result.setText("~text  "
					+ (TextUtils.isEmpty(text) ? "empty" : text));
		}
	}

}
